/**
 * @author: 善良的YWJ
 * @Created by shanliangdeYWJ on 2020/12/10 16:54:18
 * @file: index.js
 * @description:
 * ```
 * art-template 渲染
 * ```
 * @link [Github](https://github.com/shanliangdeYWJ)
 */

; (function (doc, undefined, $) {
  /**
   * 首页 主体 article
   */
  $(function ($) {
    $.ajax({ // 请求
      url: "./data/index/article.json",
      success: function (res) {
        // @ts-ignore 渲染
        var html = template('article-tpl', res)
          .replace('<!--', '')
          .replace('-->', '');
        $('#article-tpl').html(html);
      }
    });
  });

  /**
   * 首页 服务 .service-box
   */
  $(function ($) {
    $.ajax({
      url: "./data/index/service.json",
      success: function (res) {
        // @ts-ignore
        var html = template('service-tpl', res)
          .replace('<!--', '')
          .replace('-->', '');
        console.log(html);
        $('#service-tpl').html(html);
      }
    });
  });

  /**
   * 首页 服务 #nav-tpl
   */
  $(function ($) {
    $.ajax({
      url: "./data/index/router.json",
      success: function (res) {
        // @ts-ignore
        var html = template('nav-tpl', res)
          .replace('<!--', '')
          .replace('-->', '');
        console.log(html);
        $('#nav-tpl').html(html);
      }
    });
  });

})(document, undefined, $);


